﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Xml;

using System.Configuration;

namespace Weixin.Utils
{
    public class WebConfig
    {
        #region GetSettings
        public static string GetAppSetting(string key)
        {
            return ConfigurationManager.AppSettings[key];
        }

        public static string GetConnectionString(string key)
        {
            return ConfigurationManager.ConnectionStrings[key].ConnectionString;
        }
        #endregion

        public static string ChinaTax
        {
            get { return GetConnectionString("ChinaTax"); }
        }


        /// <summary>
        /// 读取XML
        /// </summary>
        /// <param name="str">字符串</param>
        /// <returns></returns>
        public static XmlDocument ReadXml(string str)
        {
            var sr = new StringReader(str);
            var xmlDocument = new XmlDocument();
            xmlDocument.Load(sr);
            return xmlDocument;
        }

    }
}
